//
//  CYCommentReplyListTableViewCell.m
//  cyydt
//
//  Created by chu on 2019/2/13.
//  Copyright © 2019 chu. All rights reserved.
//

#import "CYCommentReplyListTableViewCell.h"

@implementation CYCommentReplyListTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.headImageView.layer.cornerRadius = 25 / 2;
    self.headImageView.layer.masksToBounds = YES;
    
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapHeadImageView:)];
    [self.headImageView addGestureRecognizer:tap];
    self.headImageView.userInteractionEnabled = YES;
}

- (void)setCommentModel:(CYCommentModel *)commentModel{
    _commentModel = commentModel;
    [self.headImageView sd_setImageWithURL:[NSURL URLWithString:commentModel.headImg] placeholderImage:[UIImage imageWithColor:[UIColor lightGrayColor] Size:self.headImageView.frame.size]];
    self.nicknameLabel.text = commentModel.username;
    self.contentLabel.text = commentModel.content;
    self.timeLabel.text = commentModel.createTime;
}

- (void)tapHeadImageView:(UITapGestureRecognizer *)tap{
    CYGeRenZhuYeViewController *zhuye = [[CYGeRenZhuYeViewController alloc] init];
    zhuye.userId = self.commentModel.userId;
    [[AppDelegate sharedAppDelegate] pushViewController:zhuye];
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
